﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Inicio.aspx.vb" Inherits="Template_SAFS_VB.Inicio" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">

    <link href="css/modern.css" rel="stylesheet"/>
    <link href="css/theme-dark.css" rel="stylesheet"/>
    <link href="css/modern-responsive.css" rel="stylesheet"/>


	<script src="js/jquery.js"></script>
	<script src="js/jquery-ui-autocomplete.js"></script>
	<script src="js/jquery.select-to-autocomplete.min.js"></script>

  

        
      <style type="text/css">
        .ui-combobox {
            position: relative;
            display: inline-block;
        }
        .ui-combobox-toggle {
            position: absolute;
            top: 0;
            bottom: 0;
            margin-left: -1px;
            padding: 0;

        }
        .ui-combobox-input {
            margin: 0;
            padding: 0.3em;
        }
    
    

    </style>
   	<script type="text/javascript" charset="utf-8">
   	    (function ($) {
   	        $(function () {
   	            $('select').selectToAutocomplete();
   	            $('form').submit(function () {
   	                alert($(this).serialize());
   	                return false;
   	            });
   	        });
   	    })(jQuery);


   	    $(document).ready(function () {
   	        $("#btnBuscarBlog").click(function () {
   	            $("select option:selected");
   	            location.href = "Blog.aspx?accion=visitante&idUsuario=" + $("#combobox option:selected").attr('id');
   	        });
   	    });

       </script>

    <title>Inicio SAFS</title>

    

</head>
<body class="modern-ui">

<form id="form1" runat="server">
<div class="page secondary fixed-header">


    <div class="page-header">
        <div class="page-header-content">
            <div class="user-login">
                    <div class="name">
                        <%
                            Response.Write("<span class='first-name'>" & Session("nombre") & "</span>" &
                        "<span class='last-name'>" & Session("ap1") & " " & Session("ap2") & "</span>")
                            %>

                        
                    </div>
                    <div class="avatar">
                        <img src="images/user_default.jpg"/>
                        <asp:HyperLink ID="idSalir" runat="server" NavigateUrl="~/Login.aspx" 
                            Font-Bold="True" ForeColor="#FFFFCC">Salir</asp:HyperLink>
                    </div>
            </div>

            <h1>Inicio</h1>
        </div>
    </div>

    <div class="page-region">
	
        <div class="page-region-content tiles" >
                <%
                    Dim usuarios As List(Of Dictionary(Of String, Object)) = getListaUsuarios()
                %>

                <div style="float:right;margin-right:30px"> 
                <h3>Buscar Blog</h3>
		        <select id="combobox">

                    <option value="-1"></option>    
                    <%
                        For Each usuario As Dictionary(Of String, Object) In usuarios
                           
                            Response.Write("<option id= '" & usuario("id") & "'>" & usuario("nombre") & " </option>")
                          
                        Next
                     
                    %>
                    
                </select>
                <input type="button" value="Ir" id="btnBuscarBlog"/>
                 </div> 
		<div align="center">
            <div class="tile-group" >
					<div>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Foros.aspx">
                        <div class="tile double">
                            <div class="tile-content">
                                <h3 style="margin-bottom: 5px;">Mis Foros</h3>
                                <p>
                                    Lista de foros a los cuales pertenece
                                </p>
   
                            </div>

                        </div>
                    </asp:HyperLink>
						
					<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/Blog.aspx?accion=MiBlog">	
                        <div class="tile double">
                            <div class="tile-content">
                                <h3 style="margin-bottom: 5px;">Mi Blog</h3>
                                <p>
                                    Historial de entradas, comentarios y dem&aacute;s
                                </p>
   
                            </div>

                        </div>
                    </asp:HyperLink>
                    <% 
                        Dim html As String = ""
                        
                        html = "<a href='BuscarForos.aspx'>" &
                        "<div class='tile double'>" &
                           "<div class='tile-content'>" &
                                "<h3 style='margin-bottom: 5px;'>Buscar Foros</h3>" &
                                "<p>Lista completa de los foros</p>" &
                            "</div>" &
                        "</div>" &
                     "</a>"
                    
                        If Session("rol") = 5 Then
                            Response.Write(html)
                        End If
                        
                    

                     
                        
    html = "<a href='PaginaReportes.aspx'>" &
  "<div class='tile double'>" &
     "<div class='tile-content'>" &
          "<h3 style='margin-bottom: 5px;'>Reportes</h3>" &
          "<p>Lista completa de los reportes</p>" &
      "</div>" &
  "</div>" &
"</a>"
                    
    If Session("rol") = 3 Then
        Response.Write(html)
    ElseIf Session("rol") = 5 Then
        Response.Write(html)
                          
    End If
                         
     
                        
                    %>
                    </div>
            </div>
        </div>
    </div>
</div>


    </form>


</body>

</html>

